<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>菜鸟教程 React 实例</title>
<script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
<script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>
<h1>复合组件：将多个组件拼接到一个组件中,注意表达式要用{}包裹</h1>
<div id="example"></div>
<script type="text/babel">
	function Name(props){
		return <h2>网站名称:{props.name}</h2>;
	}
	
	function Url(props){
		return <h2>网站地址:{props.url}</h2>;
	}
	
	function App(){
		return(
			<div>
				<Name name="GitHub"/>
				<Url url = "www.github.com"/>
			</div>
		)
		
	}
	
	ReactDOM.render(
		<App/>,
		document.getElementById('example')
	);

</script>

</body>
</html>